#ifndef ELTHEME_H
#define ELTHEME_H

#include <QColor>

namespace ThemeColor {
extern QColor textColor;         // regular
extern QColor textPrimaryColor;  // primary
extern QColor textDisabledColor; // disabled

extern QColor inputDisabledColor;

extern QColor lineColor;
extern QColor lineDisabledColor;

extern QColor primaryColor;
extern QColor primaryEnteredColor;
extern QColor primaryShallowColor;
extern QColor primaryDeepColor;
extern QColor primaryDisabledColor;

extern const QColor &successColor;
extern const QColor &successEnteredColor;
extern const QColor &successShallowColor;
extern const QColor &successDeepColor;
extern const QColor &successDisabledColor;

extern const QColor &warningColor;
extern const QColor &warningEnteredColor;
extern const QColor &warningShallowColor;
extern const QColor &warningDeepColor;
extern const QColor &warningDisabledColor;

extern const QColor &dangerColor;
extern const QColor &dangerEnteredColor;
extern const QColor &dangerShallowColor;
extern const QColor &dangerDeepColor;
extern const QColor &dangerDisabledColor;

extern const QColor &infoColor;
extern const QColor &infoEnteredColor;
extern const QColor &infoShallowColor;
extern const QColor &infoDeepColor;
extern const QColor &infoDisabledColor;
} // namespace ThemeColor

class ElTheme
{
public:
    using TriColor = std::tuple<QColor, QColor, QColor>;
    enum Type { Default, Primary, Success, Warning, Danger, Information };

    ElTheme(Type type = Default);

    ElTheme &setType(Type type);
    Type type() const;

    QColor normalColor() const;
    QColor enteredColor() const;
    QColor deepColor() const;
    QColor disabledColor() const;
    QColor shallowColor() const;

    virtual ~ElTheme() = default;

    // return three kind of colors, which are entered, pressed, disabled color respectively.
    static TriColor generateTriColor(const QColor &color);
    static void togglePrimaryColor(const QColor &color);

protected:
    Type _type = Default;
    QColor _normalColor = Qt::white;
    QColor _enteredColor = Qt::white;
    QColor _deepColor = Qt::white;
    QColor _shallowColor = Qt::white;
    QColor _disabledColor = Qt::white;
};

#endif // ELTHEME_H
